Q:
Solution:
Q: What will be the output of the following JavaScript code? var txt1 = "good"; var txt2 = "day"; document.getElementById("demo").innerHTML = txt1 + txt2;
Solution: The + operator acts as a concatenation operator when used with string. The new string does not have any space between the two added string.
Q: What will be the output of the following JavaScript code?
Solution: The % operator returns the remainder between the two numbers. It is used many times with if condition to check whether the number is divisible or not.
Q: What will be the output of the following JavaScript code?
Solution: The *= operator is a shorthand expression for multiplication of a particular number. It is a combination of two operators * and = .
Q: What will be the output of the following JavaScript code?
Solution: The += operator acts in the same way as the concatenation operator in the string. There is no space added when two string are added together with += operator.
Q: What will be the output of the following JavaScript code?
Solution: The typeof operator returns the type of the argument passed to it. The typeof operator returns number for an integer and string for a character array.
Q: JavaScript Code can be called by using ___________
Solution: JavaScript code can be called by making a function call to the element on which JavaScript has to be run. There are many other methods like onclick, onload, and onsubmit etc.
Q: The type of a variable that is volatile is _______________
Solution: The variables whose values can be changed are called mutable variable types. In JavaScript, only objects and arrays are mutable, not primitive values.
Q: A hexadecimal literal begins with __________
Solution: Generally, X or x denotes hexadecimal values. So, any integer literal that begins with 0X or 0x denotes a hexadecimal number.
Q: The generalised syntax for a real number representation is __________
Solution: Floating-point literals may also be represented using exponential notation: a real number followed by the letter e (or E), followed by an optional plus or minus sign, followed by an integer exponent. This notation represents the real number multiplied by 10 to the power of the exponent.
Q: JavaScript _________ when there is an indefinite or an infinite value during an arithmetic computation.
Solution: When the result of a numeric operation is larger than the largest representable number (overflow), JavaScript prints the value as Infinity. Similarly, when a negative value becomes larger than the largest representable negative number, the result is negative infinity. The infinite values behave as you would expect: adding, subtracting, multiplying, or dividing them by anything results in an infinite value (possibly with the sign reversed).
You Have Score    | /11 |